<template>
	<view>
		<view class="form-box">
			<view class="form-item">
				<view class="item-label">我的学号</view>
				<view class="item-input-right">
					<input type="text" v-model="myInfo.s_id" disabled="true" />
				</view>
			</view>
			<view class="form-item">
				<view class="item-label">我的姓名</view>
				<view class="item-input-right">
					<input type="text" v-model="myInfo.s_name" disabled="true" />
				</view>
			</view>
			<view class="form-item">
				<view class="item-label">我的性别</view>
				<view class="item-input-right">
					<input type="text" v-model="myInfo.s_sex" disabled="true" />
				</view>
			</view>
			<view class="form-item">
				<view class="item-label">班级名称</view>
				<view class="item-input-right">
					<input type="text" v-model="myInfo.c_id" disabled="true"/>
				</view>
			</view>
			<view class="form-item">
				<view class="item-label">毕业学校</view>
				<view class="item-input-right">
					<input type="text" v-model="myInfo.s_school" disabled="true" />
				</view>
			</view>
			<view class="form-item">
				<view class="item-label">所学专业</view>
				<view class="item-input-right">
					<input type="text" v-model="myInfo.s_professional" disabled="true" />
				</view>
			</view>
			<view class="form-item">
				<view class="item-label">学历信息</view>
				<view class="item-input-right">
					<input type="text" v-model="myInfo.s_education" disabled="true" />
				</view>
			</view>
			<view class="form-item">
				<view class="item-label">毕业时间</view>
				<view class="item-input-right">
					<input type="text" v-model="myInfo.s_graduation" disabled="true"/>
				</view>
			</view>
			<button type="default" style="margin-top: 20px;" @tap="navigatorBack">返回</button>
		</view>
	</view>
</template>

<script>
	import AppConfig from '../../config/AppConfig.js';
	import {mapGetters} from 'vuex';
	export default {
		name:"myInfo",
		data(){
			return {
				myInfo:{}
			}
		},
		computed:{
			...mapGetters(["s_id"])
		},
		onLoad:function(){
			uni.showLoading({
				title:'正在加载数据'
			});
			uni.request({
				url:`${AppConfig.baseUrl}/Stu_info/getMyInfo/${this.s_id}`,
				success:(res)=>{
					if(res.data.status=="success"){
						this.myInfo=res.data.data;
					}
					else{
						uni.showToast({
							title:res.data.msg,
							icon:"none"
						});
					}
				},
				complete:function(){
					uni.hideLoading();
				}
			})
		},
		methods:{
			navigatorBack(){
				uni.navigateBack({
					delta:1
				});
			}
		},
	}
</script>

<style>
.form-box{
	margin-top: 50px;
	box-sizing: border-box;
	padding: 20px 20px;
	background: linear-gradient(to bottom,white,#f0f0f0);
}
.form-item{
	display: flex;
	flex-direction: row;
	min-height: 80px;
	margin-top: 10px;
	background-color: white;
	align-items: center;
}
.item-label{
	width: 170px;
	display: flex;
	height: 80px;
	justify-content: center;
	text-align: center;
	align-items: center;
}
.item-input-right{
	flex: 1;
	display: flex;
	align-items: center;
}
.item-input-right>input{
	width: 100%;
	height: 80px;
}
</style>
